import cmath
from linear_algebra import sum_all

delta[i] = sum_all([weights[j][i].conjugate() * dactivation(net_in[i]).conjugate() * deltas[j].conjugate() for j in following_layer]

weights[j][i] = learnrate * output(i).conjugate() * dactivation((net_in[j]).conjugate() * delta[i].conjugate()

# rules for the product-case may be constructed in the same way, just
# take the conjugate of the terms one replaces! (the conjugate arises
# (seemingly) from places in the derivation in which it doesn't matter
# whether one is dealing with product or additive neurons) JUST TRY IT
